// 编译时计算图像卷积的输出尺寸
template <int InputWidth, int InputHeight, int KernelSize, int Stride, int Padding>
struct ConvolutionOutputSize
{
    static constexpr int width = (InputWidth - KernelSize + 2 * Padding) / Stride + 1;
    static constexpr int height = (InputHeight - KernelSize + 2 * Padding) / Stride + 1;
};

// 使用示例
void process_image()
{
    constexpr int output_width = ConvolutionOutputSize<224, 224, 3, 1, 1>::width;
    constexpr int output_height = ConvolutionOutputSize<224, 224, 3, 1, 1>::height;
    // 编译时就知道输出尺寸为224x224
    float output[output_height][output_width];
    // ...
}